#!/usr/bin/env python
# encoding: utf-8
from feature_conf.loan import LoanConfigConstant
from utils import extract_bill_extension_features


class LoanIdExtensionV1():

    @staticmethod
    def get_features(data):
        cate_df = data['extension_repay_df']
        normal_df = data['normal_installment_df']
        extension_day_features_dict = {}
        for day in LoanConfigConstant.BILL_DAYS_LIST:
            day_feature = extract_bill_extension_features(cate_df=cate_df, normal_df=normal_df,
                                                          time_col='day_inter', time_inter=day,
                                                          country_id='id', version='v1')
            extension_day_features_dict.update(day_feature)

        return extension_day_features_dict
